package com.medical.doctor.service.impl;

import com.medical.doctor.entity.DoctorDepartmentEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.medical.common.utils.PageUtils;
import com.medical.common.utils.Query;

import com.medical.doctor.dao.DoctorGradeDao;
import com.medical.doctor.entity.DoctorGradeEntity;
import com.medical.doctor.service.DoctorGradeService;


@Service("doctorGradeService")
public class DoctorGradeServiceImpl extends ServiceImpl<DoctorGradeDao, DoctorGradeEntity> implements DoctorGradeService {

    @Override
    public PageUtils queryPageById(Map<String, Object> params, Integer departmentId) {
        QueryWrapper<DoctorGradeEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("department_id",departmentId);
        IPage<DoctorGradeEntity> page = this.page(
                new Query<DoctorGradeEntity>().getPage(params),
                wrapper
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DoctorGradeEntity> page = this.page(
                new Query<DoctorGradeEntity>().getPage(params),
                new QueryWrapper<DoctorGradeEntity>()
        );

        return new PageUtils(page);
    }

}